import request from "@/utils/request";

//添加优惠券
export function addCoupon(data) {
  return request({
    url: "/shop_coupons",
    method: "post",
    data: data
  });
}
// 获取优惠券列表
export function getCouponList(pageVo) {
  return request({
    url: "/shop_coupons/search",
    method: "post",
    data: pageVo
  });
}

//更新优惠券
export function updateCoupon(data) {
  return request({
    url: "/shop_coupons/" + data.id,
    method: "put",
    data: data
  });
}
// 删除优惠券
export function deleteCoupon(couponId) {
  return request({
    url: "/shop_coupons/" + couponId,
    method: "delete"
  });
}
